package com.repair.user.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.repair.api.user.constant.UserStateEnum;
import com.repair.datasource.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * <p>
 *
 * </p>
 *
 * @author 郑春雨
 * @since 2024-09-12
 */
@Getter
@Setter
@TableName("user")
@ApiModel(value = "User对象", description = "")
public class User extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("昵称")
    @TableField("nick_name")
    private String nickName;

    @ApiModelProperty("密码")
    @TableField("password")
    private String password;

    /**
     * @see UserStateEnum
     */
    @ApiModelProperty("状态")
    @TableField("state")
    private String state;

    @ApiModelProperty("手机号")
    @TableField("telephone")
    private String telephone;

    @ApiModelProperty("头像url地址")
    @TableField("profile_photo_url")
    private String profilePhotoUrl;

    @ApiModelProperty("实名认证状态: 0未认证, 1已认证")
    @TableField("authentication_status")
    private Byte authenticationStatus;

    @ApiModelProperty("真实姓名")
    @TableField("real_name")
    private String realName;

    @ApiModelProperty("身份证号")
    @TableField("id_card_num")
    private String idCardNum;

    @ApiModelProperty("逻辑删除: 0正常, 1删除")
    @TableField("deleted")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty("乐观锁版本")
    @TableField("version")
    @Version
    private Integer version;

    @ApiModelProperty("用户等级: 1重点客户, 2优质客户, 3潜力客户")
    @TableField("level")
    private String level;

    @ApiModelProperty("订单总数")
    @TableField("order_num")
    private Long orderNum;

    @ApiModelProperty("订单总金额")
    @TableField("total_order_amount")
    private BigDecimal totalOrderAmount;
}
